#pragma once
#include "RoadDesign.h"
class RoadGroup
{
public:
	RoadGroup(PRoadTerrian pTerrian);

	~RoadGroup(void);

	int LoadData(const QString& strFileName);

	void UpdateLoadData();

	void SaveData(const QString& strFileName);

	PRoadDesign GetRoad(int iInx)
	{
		return m_vpRoad[iInx];
	}

	PRoadDesign FindRoad(const ZMString& strName)
	{
		for (PRoadDesign pRoad : m_vpRoad)
		{
			if (pRoad->GetObjName() == strName)
			{
				return pRoad;
			}
		}
		assert(false);
		return PRoadDesign();
	}

	int GetRoadNum()
	{
		return m_vpRoad.size();
	}

	PRoadTerrian GetTerrian()
	{
		return m_pTerrian;
	}
protected:
	int LoadData(const QDomDocument& doc);
private:
	ZMVector<PRoadDesign> m_vpRoad;
	PRoadTerrian m_pTerrian;
};
typedef SharedPointer<RoadGroup> PRoadGroup;


